
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
 %>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>考勤管理</title>
<!--                       CSS                       -->
<!-- Reset Stylesheet -->
<link rel="stylesheet" href="/oa/css/reset.css" type="text/css" media="screen" />
<!-- Main Stylesheet -->
<link rel="stylesheet" href="/oa/css/styleMain.css" type="text/css" media="screen" />
<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
<link rel="stylesheet" href="/oa/css/invalid.css" type="text/css" media="screen" />
<!--                       Javascripts                       -->
<!-- jQuery -->
<script type="text/javascript" src="/oa/js/jquery-1.3.2.min.js"></script>
<!-- jQuery Configuration -->
<script type="text/javascript" src="/oa/js/simpla.jquery.configuration.js"></script>
<!-- Facebox jQuery Plugin -->
<script type="text/javascript" src="/oa/js/facebox.js"></script>
<!-- jQuery WYSIWYG Plugin -->
<script type="text/javascript" src="/oa/js/jquery.wysiwyg.js"></script>
<!-- jQuery Datepicker Plugin -->
<script type="text/javascript" src="/oa/js/jquery.datePicker.js"></script>
<script type="text/javascript" src="/oa/js/jquery.date.js"></script>
<script type="text/javascript" src="/oa/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/oa/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/oa/js/myDate.js"></script>
<script type="text/javascript">
    function topage(page) {
		var form = document.forms[0];
		form.currentpage.value = page;
		form.submit();
	}
	$(document)
			.ready(
					function(e) {
						$("#checkAll").click(
								function() {
									$("body :checkbox").attr("checked",
											$("#checkAll").attr("checked"));
								});
						$("#btnDel")
								.click(
										function() {
											var form = document.forms[0];
											form.action = '<s:url namespace="/control/sysmanage" action="deleteOperate" />';
											form.submit();
										});
						$("#btnSelect").click(function(){
							if($("#startDate").val() == "" || $("#endDate").val() == ""){
								alert("请选择开始和结束时间");
								return false;
							}else{
								var form = document.forms[0];
								form.action = '<s:url namespace="/control/sysmanage" action="listOperate" />';
								form.submit();
							}
						});
						$("#selectDiv :text").focus(function(){
						  this.blur();
						});
						$("#today").click(function(){
							$("#startDate").val(getNowDate());
							$("#endDate").val(getNowDate());
						});
						$("#week").click(function(){
							$("#startDate").val(getWeekStart());
							$("#endDate").val(getWeekEnd());
						});
						$("#mounth").click(function(){
							$("#startDate").val(getMonthStart());
							$("#endDate").val(getMonthEnd());
						});
					});
					
					$(document).ready(
			function(e) {
				//init
				$("#institution").attr("disabled", true);
				$("#branch").attr("disabled", true);
				$("#name").attr("disabled", true);
				$("#radio2").attr("checked", "checked");
				$("#person").hide();
				
				//text
				$("input:text").eq(1).focus(function(e) {
			        this.blur();
			    });
				$("input:text").eq(2).focus(function(e) {
			        this.blur();
			    });

				//radio
				$("#radio1").click(function(e) {
					$("#filter").fadeOut('slow');
				});
				$("#radio2").click(function(e) {
					$("#filter").fadeIn('slow');
				});

				//checkbox
				var checkbox1 = $('input:checkbox(class="check-all")');
				$(checkbox1.eq(0)).click(function(e) {
					if($(this).attr("checked")){
						checkbox1.eq(2).attr("disabled",true);
						$("#institution").attr("disabled",false);
					}
					else{
						checkbox1.eq(2).attr("disabled",false);
						$("#institution").attr("disabled",true);
						$("#institution").find("option:first").attr('selected','selected');
						$("#person").hide();
					}
			    });
				$(checkbox1.eq(1)).bind('click',function(){
					if($(this).attr("checked")){
						checkbox1.eq(2).attr("disabled",true);
						checkbox1.eq(0).attr("checked",true);
						$("#branch").attr("disabled",false);
						$("#institution").attr("disabled",false);
					}
					else{
						checkbox1.eq(2).attr("disabled",false);
						checkbox1.eq(0).attr("checked",false);
						$("#branch").attr("disabled",true);
						$("#institution").attr("disabled",true);
						$("#branch").find("option:first").attr('selected','selected');
						$("#institution").find("option:first").attr('selected','selected');
						$("#person").hide();
					}
				});
				$(checkbox1.eq(2)).click(function(e) {
					if($(this).attr("checked")){
						checkbox1.eq(0).attr("disabled",true);
						checkbox1.eq(1).attr("disabled",true);
						$("#name").attr("disabled",false);
					}
					else{
						checkbox1.eq(0).attr("disabled",false);
						checkbox1.eq(1).attr("disabled",false);
						$("#name").attr("value",'');
						$("#name").attr("disabled",true);
						$("#person").hide();
					}
			    });	

				//确定选择范围
				$("#scoping").click(
						function(e) {
							var institution = $("#institution");
							var branch = $("#branch");
							var name = $("#name");
							var institutionText = institution.find(
									"option:selected").text();
							var branchText = branch.find("option:selected")
									.text();
							var nameText = name.val();
							var pleaseSelect = "==请选择==";
							if (institution.attr("disabled") == true
									&& branch.attr("disabled") == true
									&& name.attr("disabled") == true) {
								alert("请确定范围！");
							} else {
								if (institution.attr("disabled") == false
										&& institutionText == pleaseSelect) {
									alert("请选择机构！");
									return;
								}
								if (branch.attr("disabled") == false
										&& branchText == pleaseSelect) {
									alert("请选择部门！");
									return;
								}
								if (name.attr("disabled") == false
										&& nameText == "") {
									alert("请输入名字！");
									return;
								}
								$("#person").fadeIn('slow');
							}
						});

				//全选
				$("#checkAll").click(
						function() {
							$("#person :checkbox").attr("checked",
									$("#checkAll").attr("checked"));
						});
			});
</script>
</head>

<body>
<div>
  <!-- Wrapper for the radial gradient background -->
  </div>
    <!-- Main Content Section with everything -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
      <!-- Start Content Box --></div>
      <div class="content-box-header">
        <h3>员工考勤统计</h3>
        <ul class="content-box-tabs">
          <li><a href="#tab1" class="default-tab">浏览</a></li>
          <!-- href must be unique and match the id of target div -->
          <li><a href="#tab2">查看</a></li>
        </ul>
       <s:form namespace="/control/attendance" action="listQueryHistory" id="queryForm">
		<div id="selectDiv">
			选择日期:
			<s:textfield id="startDate" name="startDate"  onclick="WdatePicker()" />
			<s:textfield id="endDate" name="endDate" onclick="WdatePicker()" />
			<input type="radio" id="today"  name="date"/>本日
			<input type="radio" id="week"  name="date"/>本周
			<input type="radio" id="mounth" name="date"/>本月
			
		</div>
          
          <p>机构：          
          
            <select name="select" id="roleName" >
              <option value="">==请选择==</option>
              <option value="ckgly">中国科学院声学研究所</option>
              <option value="cly">华北电力科学研究所</option>
              <option value="xmjl">北大青鸟集团</option>
              <option value="admin">大唐国际盘山发电有限公司</option>
            </select> 
            部门
          
            
            <select name="select2" id="select" >
              <option value="">==请选择==</option>
              <option value="ckgly">销售部</option>
              <option value="cly">研发部</option>
              <option value="xmjl">培训部</option>
              <option value="admin">发电部</option>
            </select> <a href="#tab2">
             <input name="submit" type="submit" id="scoping" class="button" value="统计" onclick="location.href='<s:url action="statistics" namespace="/control/attendance"/>';"/>
            </a>
            <input name="submit2" type="submit" class="button" value="导入Exce打印" />
           
         
     </p>
      </s:form>
    </div>  
      
        <!-- End #tab1 -->
  <div class="tab-content" id="tab2">
 
    <s:form action="#" method="post">
      
            <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
        <table class="data_list_table"> 
		<tr> 
			<th>姓名</th> 
			<th>出勤率</th> 
			<th>迟到次数</th> 
			<th>早退次数</th> 
			<th>旷工次数</th> 
			<th>所属部门</th> 
		</tr> 
		<s:iterator value="pageView.records" status="entry"> 
			<tr>			 
				<td class="list_data_text">${user.userName}</td> 
				<td class="list_data_number">${user.signTag.userAttendance}</td> 
				<td class="list_data_number">${user.signTag.userLater}</td> 
				<td class="list_data_number">${user.signTag.userLeaveEarly}</td> 
				<td class="list_data_number">${user.signTag.userAbsenteeism}</td> 
				<td class="list_data_text">${user.depart.name}</td> 
				 
			</tr> 
		</s:iterator>			 
		 
		<tr>
				<th colspan="7" class="pager">
					<div class="pager">
						<s:include value="/page/share/paging.jsp"></s:include>
					</div></th>
			</tr>
		<tr> 
			<th colspan="7" class="pager"> 
				<div class="pager"> 
					共<s:property value="pageView.totalrecord" />条记录  
				</div> 
			</th> 
		</tr> 
	 
	 
                        
                 
              </table>
            
            <p>制表人：
              <s:textfield height="30" type="text" name="text22" value="" size="20"/> 
              上报日期：
              <s:textfield height="30" type="text" name="text25" value="" size="20"/>
            </p>
      
              <div class="clear">
              <small>&#169; Copyright 2012 十进制 | 集美大学十进制项目小组</small>
              </div>
              <!-- End .clear -->
      </s:form>
        </div>
          <!-- End #tab2 -->
      

 </body>   
 
 <span class="searchPanel"></span></body>
<!-- Download From www.exet.tk-->
</html>
